home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 26 / AACD 26.iso / AACD / Games / WHDLoad / Install < prev    next >
Encoding:
Text File  |  2000-09-05  |  3.9 KB  |  170 lines

  1. ;----------------------------
  2. ; Check version and install if newer
  3. ; IN:    #source-file
  4. ;    #dest-file
  5.  
  6. (procedure P_install
  7.   (set #sver (getversion #source-file))
  8.   (if
  9.     (exists #dest-file)
  10.     (set #dver (getversion #dest-file))
  11.     (set #dver 0)
  12.   )
  13.   (if
  14.     (< #sver #dver)
  15.     (abort
  16.       "The installation has determinated that the already installed program "
  17.       "\"" #dest-file "\" has a newer version than the program to install. "
  18.       "The current WHDLoad package seems to be outdated. Therefore the "
  19.       "installation will be canceled. Please try to get a newer version of "
  20.       "the WHDLoad package."
  21.     )
  22.   )
  23.   (set #prompt
  24.     (
  25.       "\nNow installing the program\n\n\"%s\" with version %ld.%ld\n\n"
  26.       (fileonly #source-file) (/ #sver 65536) (BITAND #sver 65535)
  27.     )
  28.   )
  29.   (if
  30.     (> #dver 0)
  31.     (set #prompt 
  32.       (
  33.         "%sby overwriting\n\n\"%s\" with version %ld.%ld"
  34.         #prompt #dest-file (/ #dver 65536) (BITAND #dver 65535)
  35.       )
  36.     )
  37.     (set #prompt ("%sinto the directory\n\n\"%s\"" #prompt (pathonly #dest-file)))
  38.   )
  39.   (if
  40.     (= @user-level 2)
  41.     (set #choice
  42.       (askbool
  43.         (prompt #prompt)
  44.         (default 1)
  45.         (choices "Install" "Skip")
  46.         (help @askbool-help)
  47.       )
  48.     )
  49.     (set #choice 1)
  50.   )
  51.   (if
  52.     (= #choice 1)
  53.     (copyfiles
  54.       (help @copyfiles-help)
  55.       (source #source-file)
  56.       (dest (pathonly #dest-file))
  57.       (newname (fileonly #dest-file))
  58.     )
  59.   )
  60. )
  61.  
  62. ;----------------------------
  63.  
  64. (if
  65.   (exists "C/InstallBB")
  66.   (set #mode "dev")
  67.   (set #mode "usr")
  68. )
  69.  
  70. (if
  71.   (= #mode "dev")
  72.   (welcome
  73.     "Welcome to the WHDLoad installation.\n"
  74.     "This script will copy all files which need a special location to their recommend places.\n"
  75.     "All other files like the source examples and the Install Templates will not copied."
  76.     "Therefore it is recommend to move this drawer yourself to your prefered location.\n"
  77.     "If you don't want to install all provided programs, please select the expert mode where you can skip these."
  78.   )
  79.   (welcome
  80.     "Welcome to the WHDLoad installation."
  81.   )
  82. )
  83.  
  84. (set @default-dest
  85.   (askdir
  86.     (prompt "Where should WHDLoad and the other tools installed ?\nThe location must be reachable via the path !\nRecommend is \"C:\".")
  87.     (help @askdir-help)
  88.     (default "C:")
  89.     (disk)
  90.   )
  91. )
  92.  
  93. (set #path "C")
  94. (foreach #path "#?"
  95.   (
  96.     (set #source-file (tackon #path @each-name))
  97.     (set #dest-file   (tackon @default-dest @each-name))
  98.     (P_install)
  99.   )
  100. )
  101.  
  102. (if
  103.   (= #mode "dev")
  104.   (
  105.     (set #dest
  106.       (askdir
  107.         (prompt "Where should the include files installed ?")
  108.         (help @askdir-help)
  109.         (default "Includes:")
  110.       )
  111.     )
  112.     (set #path "include")
  113.     (foreach #path "#?"
  114.       (copyfiles
  115.         (help @copyfiles-help)
  116.         (source (tackon #path @each-name))
  117.         (dest #dest)
  118.       )
  119.     )
  120.     (set #dest
  121.       (askdir
  122.         (prompt "Where should the autodoc file installed ?")
  123.         (help @askdir-help)
  124.         (default "Autodocs:")
  125.       )
  126.     )
  127.     (copyfiles
  128.       (help @copyfiles-help)
  129.       (source "autodoc/whdload.doc")
  130.       (dest #dest)
  131.     )
  132.     (exit
  133.       "\n"
  134.       "Installation is complete.\n"
  135.       "\n"
  136.       "All files which need a special location has been copied.\n"
  137.       "Please move all other files yourself to your prefered place.\n"
  138.       "\n"
  139.       "Hope WHDLoad and the tools will be useful for you.\n"
  140.       "\n"
  141.       "Bye Bert."
  142.       (quiet)
  143.     )
  144.   )
  145.   (
  146.     (set #dest
  147.       (askdir
  148.         (prompt "Where should the documentation for WHDLoad installed ?\nA drawer WHDLoad will be created there.")
  149.         (help @askdir-help)
  150.         (default "Help:")
  151.       )
  152.     )
  153.     (copyfiles
  154.       (help @copyfiles-help)
  155.       (source "Docs")
  156.       (dest (tackon #dest "WHDLoad"))
  157.       (all)
  158.       (infos)
  159.     )
  160.     (exit
  161.       "\n"
  162.       "Installation is now complete.\n"
  163.       "Please read the documentation carefully on how to use and configure WHDLoad for your needs."
  164.       (quiet)
  165.     )
  166.   )
  167. )
  168.  
  169.  
  170.